<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:tiles="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8"/>
    <title tiles:fragment="title">setInfo</title>

    <link href="../../../static/css/all.css" type="text/css" rel="stylesheet"/>
    <script src="../../../static/js/main.js"></script>
</head>

<body>

<div class="content" th:fragment="content" tiles:fragment="content">
    <div class="content-nav">
        <div class="titleNav">
            <div class="title_nav title_nav_previous">
                <a href="additem.html">添加物品</a></div>
            <div class="title_nav title_nav_Now"><a>详细信息</a></div>
        </div>
    </div>

    <div class="content-info myInfoList myInput">
        <form action="storage_form.html" th:action="@{additem}"
              th:method="get">

            <!--/*@thymesVar id="item_info" type="com.repository.other.ItemInfo"*/-->
            <ul th:if="${item_info.isInStorage()!=true}">
                <!--<div th:text="${item_info.entries.size()}"></div>-->
                <li th:each="entry:${item_info.entries}">
                    <label>
                        <div class="name" th:text="${entry.getKey().key_cn}">
                            物品名称：
                        </div>
                        <div class="value" th:if="${entry.getKey().key_en != 'itemcategoryID'}">
                            <input type="text" name="item_name" th:name="${entry.getKey().key_en}"/>
                        </div>
                        <div class="value" th:if="${entry.getKey().key_en == 'itemcategoryID'}">
                            <select name="item_type">
                                <option value=" "
                                        th:if="${session.categories == null || session.categories.empty}"
                                        th:text="没有找到分类,请刷新重试">
                                    没有找到分类
                                </option>
                                <option value="类别1"
                                        th:each="category : ${session.categories}"
                                        th:value="${category.categoryId}"
                                        th:text="${category.categoryName}">
                                    类别1
                                </option>
                            </select>
                        </div>
                    </label>
                </li>
                <li>
                    <div>
                        <input class="submitBt" type="submit" value="提交信息"/>
                    </div>
                </li>
            </ul>

            <ul th:if="${item_info.isInStorage()==true}">
                <li th:each="entry:${item_info.entries}">
                    <label>
                        <div class="name" th:text="${entry.getKey().key_cn}">
                            物品名称：
                        </div>
                        <div class="value disabled" th:if="${entry.getKey().key_en!='itemCount'}">
                            <input type="text" disabled="disabled"
                                   th:name="${entry.getKey().key_en}"
                                   th:value="${entry.value}"/>
                        </div>
                        <div class="value" th:if="${entry.getKey().key_en=='itemCount'}">
                            <input type="text"
                                   th:name="${entry.getKey().key_en}"
                            />
                        </div>
                    </label>
                </li>
                <li>
                    <div>
                        <input class="submitBt" type="submit" value="提交信息"/>
                    </div>
                </li>
            </ul>
        </form>
    </div>
</div>

</body>
</html>